package com.boot2.core.dao.i;


import com.boot2.core.dao.jpa.LongAbsctractDao;
import com.boot2.core.model.PositionCity;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

/**
 * @author zhangweilin
 * @ClassName: PositionCityJpaDao
 * @Description: 【行政区域-城市】 jpa dao
 * @date 2019-2-26 15:57:20
 */
@CacheConfig(cacheNames = {"model:positionCity:positionCityDao"})
public interface PositionCityDao extends LongAbsctractDao<PositionCity> {
//public interface PositionCityDao extends JpaRepository<PositionCity, Long>, JpaSpecificationExecutor<PositionCity> {

    /**
     * 精确查找市
     *
     * @param cityName
     * @return
     */
    @Cacheable(key = "methodName +#p0")
    PositionCity findFirstByCityName(String cityName);


    /**
     * 模糊 查找
     *
     * @param cityName
     * @return
     */
    @Cacheable(key = "methodName +#p0")
    PositionCity findFirstByCityNameLike(String cityName);

}